<template>
  <div class="my_card">
    <div class="my_card_title van-hairline--bottom">
      <div class="my_card_title_l">
        <div class="my_card_title_b" :style="{background: bColor}"></div>
        {{title}}
      </div>
      <div class="my_card_title_r">
        <slot name="title-r"></slot>
      </div>
    </div>
    <div class="my_card_content">
      <slot name="content"></slot>
    </div>
  </div>
</template>

<script>
export default {
  name: 'Card',
  props: {
    title: {
      type: String
    },
    bColor: {
      type: String,
      default: '#008cf0'
    }
  }
}
</script>

<style scoped lang="less">
.my_card{
  width: 100%;
  padding: 5px 10px;
  border: 1px solid #f0f0f0;
  border-radius: 5px;
  box-sizing: border-box;
  .my_card_title{
    width: 100%;
    padding: 8px;
    box-sizing: border-box;
    display: flex;
    position: relative;
    .my_card_title_b{
      width: 2px;
      height: 15px;
      transform: translateX(-17px);
    }
    .my_card_title_l{
      flex: 1;
      display: flex;
      align-items: center;
    }
  }
  .my_card_content{
    padding: 8px;
  }
}
</style>
